package com.yuyou.fn.educational.service.impl;

import com.yuyou.fn.common.util.TimeUtils;
import org.springframework.stereotype.Service;

import com.yuyou.fn.educational.mapper.PayRecordMapper;
import com.yuyou.fn.educational.entity.PayRecord;
import com.yuyou.fn.educational.service.IPayRecordService;
import com.github.wens.framework.service.impl.SuperServiceImpl;

import java.math.BigDecimal;

/**
 *
 * PayRecord 表数据服务层接口实现类
 *
 */
@Service
public class PayRecordServiceImpl extends SuperServiceImpl<PayRecordMapper, PayRecord,Long> implements IPayRecordService {


    @Override
    public void savePayRecord(Long courseOrderId, BigDecimal payAmount, Integer payWay, String operator) {
        PayRecord payRecord = new PayRecord();
        payRecord.setAmount(payAmount);
        payRecord.setCourseOrderId(courseOrderId);
        payRecord.setOperator(operator);
        payRecord.setCreateTime(TimeUtils.now());
        payRecord.setUpdateTime(TimeUtils.now());
        payRecord.setPayWay(payWay);
        insertSelective(payRecord);
    }
}